def solution(ages):
    if len(ages) <= 1:
        return ages
    bigger = 0
    smaller = 0
    for i in range(len(ages)):
        if ages[i] > ages[bigger]:
            smaller = bigger
            bigger = i
        elif ages[i] > ages[smaller]:
            smaller = i
    return [ages[smaller], ages[bigger]]


if __name__ == '__main__':
    ages = [1]
    print(solution(ages))
